<?php

use yii\helpers\Html;
use yii\grid\GridView;



$this->title = '邮轮管理';
$this->params['breadcrumbs'][] = $this->title;


?>
<div class="cruise-index">

    <h2 class="page-header"><?= Html::encode($this->title) ?>
        <p class="pull-right"><?= Html::a('创建邮轮', ['create'], ['class' => 'btn btn-success']) ?></p>
    </h2>

    <p>
        <?php echo $this->render('_search', ['model' => $searchModel]); ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        //'filterModel' => $searchModel,
        'layout'  =>  "{items}\n{pager}",
        'columns' => [
            //['class' => 'yii\grid\SerialColumn'],

            'name',
            'en_name',
            'code',
            [
                'label'=>'其它信息',
                'format'=>'raw',
                'value' => function($model){
                   
                    $url = sprintf("/cruise/room/index?cruise_id=%d", $model->id);
                    $str = Html::a('<i class="fa fa-hotel"></i>',$url,['title' => '舱房', 'target'=>'_blank'])."&nbsp;&nbsp;";
                        
                    return $str;
                }
            ],
            [
                'class' => 'yii\grid\ActionColumn',
                'header' => '操 作',
                'template' =>"{view} {update}"
            ],
        ],
    ]); ?>
</div>
